package com.example.kotlin_mvc_android

import android.os.Bundle
import android.widget.Button
import android.widget.Spinner
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    val expert = ProgramExpert()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        val button:Button = findViewById(R.id.button)
        val spinner:Spinner = findViewById(R.id.spinner)
        val textView:TextView =findViewById(R.id.textView)
        button.setOnClickListener{
            //拿到”选择“的特征
//            val selectedFeature = spinner.selectedItem.toString()

            textView.text = expert.getLanguage(spinner
                .selectedItem.toString())
        }

        }
    }
